{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As usual there is no one unique solution ! \n",
    "\n",
    "Here is an example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def aln_Convert(input,  output, input_format=\"clustal\", output_format=\"stockholm\"):\n",
    "   alignments = AlignIO.parse(input, input_format)\n",
    "   count = AlignIO.write(alignments, output, output_format)\n",
    "   print(\"Converted %i alignments\" % count)\n",
    "\n",
    "\n",
    "aln_Convert(\"data/muscle-patato_pep.clw\",\"muscle-patato_pep.stk\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> Converted 1 alignments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "os.system(\"head -4 muscle-patato_pep.stk\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> \\# STOCKHOLM 1.0   \n",
    "> \\#=GF SQ 10   \n",
    "> PGSC0003DMP400022612 -------------------------------------------------------------------------------------------------------------------------------MLPFESIEEASMSLGRNLTFGETLWF----------------------------NYTADKSDFYLYCHNTIFLI--------------------------------------------------------------------------------------------------------------------------------------IF------------------YSLV--PLPMVMIEL-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------LRSKKFEI-------------------------------------------------------------------------YKIQPKTTLTLSEMME-----------------------CYRKVLMTFVFAVG-------P------LQLFSYPIIEWVGIRTSLPLPSASEVFWQLVVYFV---------------------------------------------------------------------------------------VEDYANYWLHRMLHHYK--------------------------------------------------------------------WGY--DKIHSVHHEYVAPISFAAPYAHWAE-----IIILGLASFLGPLLVPCHMFTFLLWFVLR--------QIEAIETHSGYEFPWSPS-------------------KYIPFY-----------------------------------------------------------GGAIYHDY---HHFVGESCHSNFASVFTYCDYIYGTDKGFRYQKEVFEKRREKLRMEE---------------KVNGSAPLFKSE-----------   \n",
    "> \\#=GS PGSC0003DMP400022612 AC PGSC0003DMP400022612"
   ]
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 0
}
